<%@ Control Language="C#" AutoEventWireup="true"
	Inherits="System.Web.Mvc.ViewUserControl<ResumesController.ResumeFormViewModel>" %>
<%@ Import Namespace="ETestIT.Core" %>
<%@ Import Namespace="ETestIT.Web.Controllers" %>
<%@ Import Namespace="MvcContrib.FluentHtml" %>
 

<% if (ViewContext.TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()] != null) { %>
    <p id="pageMessage"><%= ViewContext.TempData[ControllerEnums.GlobalViewDataProperty.PageMessage.ToString()]%></p>
<% } %>

<%= Html.ValidationSummary() %>

<% using (Html.BeginForm<ResumesController>(x => x.Create(), FormMethod.Post, new { enctype = "multipart/form-data" }))
   { %>
    <%= Html.AntiForgeryToken() %>
    <%= Html.Hidden("Resume.Id", (ViewData.Model.Resume != null) ? ViewData.Model.Resume.Id : 0)%>

    <ul>
		<li>
			<label for="Resume_File">File:</label>
			<div>
				<%= this.FileUpload("Resume.File")%>
			</div>
		</li>
	    <li>
            <%= Html.SubmitButton("btnSave", "Save") %>
	        <%= Html.Button("btnCancel", "Cancel", HtmlButtonType.Button, 
				    "window.location.href = '" + Html.BuildUrlFromExpression<ResumesController>(c => c.Index()) + "';") %>
        </li>
    </ul>
<% } %>
